import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/interact_user_task_list_entity.dart';

InteractUserTaskListEntity $InteractUserTaskListEntityFromJson(
    Map<String, dynamic> json) {
  final InteractUserTaskListEntity interactUserTaskListEntity = InteractUserTaskListEntity();
  final int? mid = jsonConvert.convert<int>(json['mid']);
  if (mid != null) {
    interactUserTaskListEntity.mid = mid;
  }
  final int? taskId = jsonConvert.convert<int>(json['task_id']);
  if (taskId != null) {
    interactUserTaskListEntity.taskId = taskId;
  }
  final String? taskName = jsonConvert.convert<String>(json['task_name']);
  if (taskName != null) {
    interactUserTaskListEntity.taskName = taskName;
  }
  final int? state = jsonConvert.convert<int>(json['state']);
  if (state != null) {
    interactUserTaskListEntity.state = state;
  }
  final int? giveMoney = jsonConvert.convert<int>(json['give_money']);
  if (giveMoney != null) {
    interactUserTaskListEntity.giveMoney = giveMoney;
  }
  final String? describe = jsonConvert.convert<String>(json['describe']);
  if (describe != null) {
    interactUserTaskListEntity.describe = describe;
  }
  return interactUserTaskListEntity;
}

Map<String, dynamic> $InteractUserTaskListEntityToJson(
    InteractUserTaskListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['mid'] = entity.mid;
  data['task_id'] = entity.taskId;
  data['task_name'] = entity.taskName;
  data['state'] = entity.state;
  data['give_money'] = entity.giveMoney;
  data['describe'] = entity.describe;
  return data;
}

extension InteractUserTaskListEntityExtension on InteractUserTaskListEntity {
  InteractUserTaskListEntity copyWith({
    int? mid,
    int? taskId,
    String? taskName,
    int? state,
    int? giveMoney,
    String? describe,
  }) {
    return InteractUserTaskListEntity()
      ..mid = mid ?? this.mid
      ..taskId = taskId ?? this.taskId
      ..taskName = taskName ?? this.taskName
      ..state = state ?? this.state
      ..giveMoney = giveMoney ?? this.giveMoney
      ..describe = describe ?? this.describe;
  }
}